home *** CD-ROM | disk | FTP | other *** search
/ Hackers Handbook - Millenium Edition / Hackers Handbook.iso / library / crack99 / cbd3.txt < prev    next >
Encoding:
Text File  |  1999-03-24  |  16.4 KB  |  274 lines

  1.                 _CbD_ Tutorial #3
  2.             Function Disabled Protections Defeated
  3.                 Date  7-28-97
  4.             Target: WinScan version 2.0.06
  5.  
  6. About the Protection:
  7.     Function Disabled Protections are very comman now days and are one of 
  8.     the most popular among high priced software or specialty software. But 
  9.     there days of stoping us are over........ Now !!!!!!
  10.  
  11. Target:
  12.     WinScan ver 2.0.06
  13.     WinScan is an intelligent scan, trace and vector editing program designed for use with TWAIN compliant     scanners and popular vector illustration packages such as CorelDRAW. This is a very handy program
  14.     if you are in the graphics industry or if you make vinyl signs with plotters (As i Do)...
  15.  
  16. Where to get it :
  17.     http://www.airmark.com/
  18.  
  19. Tools Needed:
  20.     SoftIce (SI) (Required)
  21.     W32dasm ( optional)
  22.     Hiew Hexeditor (included with Tutorial) (Required)
  23.     Borland Resource Work Shop (optional)
  24.  
  25. Pre Crack Notes:
  26.     Ok there are several different steps in this crack and there are really 3 cracks that will be done
  27.     each one of them will have several steps each. If you dont have the optional Tools above
  28.     you will only be able do complete the first 2 parts of this tutorial. (The important ones)
  29.     the Last section of the crack only  removes the DEMO messages at start and in the about box.
  30.     it will change them to the registered Messages instead.. ( Big Deal i know)...
  31.  
  32. The Crack..........
  33.     Ok you should have gotten the programs you need by now so lets start the crack.
  34.     
  35. Step #1 :
  36.     Fire up your program (WinScan) and have a look at it, You should see the Big ugly blue box that
  37.     says this is a DEMO version of the program (Like we didnt know this) it is not that big of a deal
  38.     because it goes away if you click on it . But now open one of the sample .bmp files that 
  39.     are in the WinScan Dir. Now try to save the file, you will get a box that says 
  40.     " This Command is not Allowed Blah Blah Blah" ok so it dont want us to save, But we want to
  41.     I mean shit how can you evalutate software if you cant save the work to see its quality?
  42.     well I dont think you can so we will cure this problem :-).
  43.     Just remember that this little message came to us in the form of a message box.
  44.  
  45. Step #2:
  46.     Now we have a good idea that we are getting the nag from a message box so 
  47.     if we can break at the message we can see what calls it right. or we could use     
  48.     W32dasm and located the point that the message is called. well that would take
  49.     a bit longer to trace out the code that calls it so we will save that for later or for those
  50.     that want to learn a bit more about finding this type of protection calls.
  51.     so for now we are just gonna use SI (as it is all that is really needed) to break on the 
  52.     message that we get when we try to save. So lets start....
  53.     First press Ctrl-D to get in SI(Softice) and lets see what we have here, Lets see if we
  54.     have any breakpoints left over from a project that you was working on before you 
  55.     started this one so do this    BL   This will give you a listing of all breakpoints you 
  56.     have set in SI. Well we dont want those to cause us problems in this crack so we
  57.     will do one of 2 things (1) Clear them with BC *  (2) disable them with  BD *   if you 
  58.     dont need the BP's (BreakPoints) you can clear them, if you will need them for
  59.     another project then just disable them for now. Ok now that we have that out of the
  60.     way( Bare in Mind i write my tut's so anyone can follow them even if they have
  61.     never cracked before) Lets set our BreakPoints that we will need for this crack
  62.     so lets Do this BPX MESSAGEBOXA   <--- This will make SI break when the 
  63.     call to the Messagebox is made. For now that is the only one we need so lets
  64.     Ctrl-D back to our target WinScan.
  65. Step #3:
  66.     Ok now lets set all this in motion, So try to save this file with the [SAVE] from the menu
  67.     or the Disk Icon in the Toolbar. Boom to softice we go Now we are in SI at the
  68.     point our program is ready to show us the nag. Now lets think about what we
  69.     want to do here (1) we want to find out where this call came from (2) we want to 
  70.     make it go to the real save Dlg Box and not this nag. So we will do a F11 so we
  71.     can get back to what called this function. You will pop back into WinScan where
  72.     you will see the Nag. Press Ok and you will pop back to SI Now we are not there yet
  73.     cause if you look on the Line between the Command window and the Code window
  74.     you will see MFC blah  blah blah well this is the place that our message box was called
  75.     but this is not our program, Our program called this to get the box so what we will do is 
  76.     press F10 (single Step) till we get back to our program so press F10 till you see
  77.     WinScan on the line between the command and code windows. when you get there
  78.     you should see somthing like the following
  79.  
  80. (note the addresses may not be the same on yours)
  81.  
  82. 0137:00455AF5        CALL    0045D800           <----- This is what calls our little MessageBox
  83. 0137:00455AFA        JMP     00455B1E     <---- Ok we told him he cant save  so lets go back
  84. 0137:00455AFC        MOV    ECX, [EBP-14]     <---- not important.
  85.  
  86. ok now we found the call so lets scroll up a few lines and see what we can see. Should like like this
  87.  
  88. (note the addresses may not be the same on yours)
  89. 0137:00455AE0        MOV     EAX,[EAX+4]                                             <--- set demo flag
  90. 0137:00455AE3        CMP    DWORD PTR  [EAX + 000000C4] ,00 <-- check and see if this is a demo ver
  91. 0137:00455AEA        JZ    00455B16                                                 <---- if  Zero then this is a Full ver else                                                                                                                                            this is a Demo
  92. 0137:00455AEC        PUSH    FF                                                         <--- save some info
  93. 0137:00455AEE        PUSH    10                                                               <--- save some more info 
  94. 0137:00455AF0        PUSH     0000009D                                        <--- yup save even more info
  95. 0137:00455AF5        CALL    0045D800                                                 <----- This is what calls our little                                                                                                                                              MessageBox
  96. 0137:00455AFA        JMP     00455B1E                                                 <---- Ok we told him he cant save  so lets                                                                                                                                            
  97.                                                                                                                                             go on working
  98. 0137:00455AFC        MOV    ECX, [EBP-14]                                           <---- not important.
  99.  
  100.     ok if you look real close i think you can see what we need to do now and if you cant i will
  101.     tell you:
  102. 0137:00455AEA        JZ    00455B16     This jump here will send us to the real save dialog that we
  103.                         want .
  104.     So we need to change the JZ to a JNZ so that the program will think that if we are a DEMO
  105.     we should jump to the real Save Dialog and not the Nag. But before we do this lets get some info
  106.     that we will need for part 2 of the crack  so Do a      D xxxx:00455AEA    (xxxx is the address you see)
  107.     now look in your data window for something like this 
  108.  
  109. 0137:00455AEA        74   2A   6A   FF   6A   10   68   9D - 00   00   00   E8   06   7D  00   00
  110.              ^     ^      ^      ^      ^       ^      ^     ^      
  111.     You will need all these number sets that have a ^ under them so right them down
  112.     (Note if you do not have a Data window just above your code window type WD and press enter
  113.     in the commad window and it should open up you should also have your Registers window
  114.     open as well and to do this type WR and press enter in the command window)
  115.     Well lets see if we are right do this  
  116.     A xxxx:00455AEA  and press enter (note where the xxxx is put the right address you see on 
  117.     your screen)
  118.     now you should see somthing like this
  119.  
  120. A xxxx:00455AEA
  121. xxxx:00455AEA       
  122.     
  123.     in your command window
  124.     you need to type in this 
  125.     
  126.     JNZ 00455B16         
  127.  
  128.     then press enter and then press enter again to get back to the command line
  129.     now lets see if this werks so press Ctrl-D and when you pop back to WinScan
  130.     try to save again   WOW you can now save . Well the only thing is that you cant use the 
  131.     Save As function so we need to fix that to and to do this we follow the same steps as above
  132.     but instead of pressing the Save we press Save As from the Menu
  133.     and you will break right back in the same Message that you did before
  134.     you need only to follow then same steps as above to get back to the WinScan
  135.     call and then scroll back up and find the JZ that will send us to where we want to go
  136.  
  137.     if you cant seem to make it werk here is the steps for this one
  138.  
  139. Step #1:
  140.     Ok now lets set all this in motion, So try to save this file with the [SAVE AS] from the menu
  141.      Boom to softice we go Now we are back in SI at the same 
  142.     point our program is ready to show us the nag. Now lets think about what we
  143.     want to do here (1) we want to find out where this call came from (2) we want to 
  144.     make it go to the real save Dlg Box and not this nag. So we will do a F11 so we
  145.     can get back to what called this function. You will pop back into WinScan where
  146.     you will see the Nag. Press Ok and you will pop back to SI Now we are not there yet
  147.     cause if you look on the Line between the Command window and the Code window
  148.     you will see MFC blah  blah blah well this is the place that our message box was called
  149.     but this is not our program, Our program called this to get the box so what we will do is 
  150.     press F10 (single Step) till we get back to our program so press F10 till you see
  151.     WinScan on the line between the command and code windows. when you get there
  152.     you should see somthing like the following
  153.  
  154. (note the addresses may not be the same on yours)
  155.  
  156. 0137:00455BD5        CALL    0045D800           <----- This is what calls our little MessageBox
  157. 0137:00455BDA        JMP     00455BFE     <---- Ok we told him he cant save  so lets go back
  158. 0137:00455BDC    MOV    ECX, [EBP-14]     <---- not important.
  159.  
  160. ok now we found the call so lets scroll up a few lines and see what we can see. Should like like this
  161.  
  162. (note the addresses may not be the same on yours)
  163. 0137:00455BC0        MOV     EAX,[EAX+4]                                             <--- set demo flag
  164. 0137:00455BC3        CMP    DWORD PTR  [EAX + 000000C4] ,00 <-- check and see if this is a demo ver
  165. 0137:00455BCA        JZ    00455BF6                                                <---- if  Zero then this is a Full ver else                                                                                                                                                                                this is a Demo
  166. 0137:00455BCC    PUSH    FF                                                         <--- save some info
  167. 0137:00455BDE    PUSH    10                                                               <--- save some more info 
  168. 0137:00455BD0        PUSH     0000009D                                        <--- yup save even more info
  169. 0137:00455BD5        CALL    0045D800                                                 <----- This is what calls our little                                                                                                                                              MessageBox
  170. 0137:00455BDA        JMP     00455BFE                                                 <---- Ok we told him he cant save  so lets                                                                                                                                            
  171.                                                                                                                                             go on working
  172. 0137:00455BDC    MOV    ECX, [EBP-14]                                           <---- not important.
  173.  
  174.     ok if you look real close i think you can see what we need to do now and if you cant i will
  175.     tell you:
  176.  
  177. 0137:00455BCA        JZ    00455BF6    This jump here will send us to the real save dialog that we
  178.                         want .
  179.     So we need to change the JZ to a JNZ so that the program will think that if we are a DEMO
  180.     we should jump to the real Save Dialog and not the Nag. Well lets see if we are right
  181.     do this  A xxxx:00455BCA  and press enter (note where the xxxx is put the right address you see on 
  182.     your screen:
  183.     now you should see somthing like this
  184.  
  185. A xxxx:00455BCA
  186. xxxx:00455BCA       
  187.     in your command window
  188.     you need to type in this 
  189.     
  190.     JNZ 00455BF6         
  191.  
  192.     then press enter and then press enter again to get back to the command line
  193.     now lets see if this werks so press Ctrl-D and when you pop back to WinScan
  194.     try to SAVE AS again   WOW you can now Save As   now isnt this fun
  195.  
  196.     well the only thing is that this will only werk till we exit our program, When we restart it  the nags
  197.     will be right back so now we need to make a real crack for our program.
  198.     so on to part 2 of this Crack
  199.  
  200. Part 2: Hex Editing our program
  201.  
  202.     well lets make sure we have all the info we will need..
  203.     Remeber the things i told you to write down  well i hope you did ;-)
  204.     and if not then here it is 
  205. xxxx:00455AEA        74   2A   6A   FF   6A   10   68   9D
  206.     well we will need this in Hiew to search for our Jumps we need to change
  207.     (by the way you should print this file to make lie easier on you)
  208.     Lets make a backup copy of our file you can name it what ever you wish (i used
  209.     WinScan.cbd) just dont use the .bak as this is needed else where
  210.     So lets fire up Hiew to do this we will need to have the program and Hiew in the 
  211.     same Directory I use a Temp dir and copy both files to it (Hiew and Winscan.cbd)
  212.      now at a dos prompt type     
  213.              (the numbers in ( ) are the steps)
  214.     (1) Hiew WinScan.cbd (or what ever you named it) now you will be in the Hiew program and will see a 
  215.     bunch of shit that makes no sence what so ever 
  216.     (2) so press the F4 key to get the Hex View (or what ever the key is at the     
  217.     bottom) now we will have to search for our command and in order to do this we will
  218.     need to have the numbers above 
  219.     (3) so press F7 and then enter the numebrs above
  220.     ie ( 74 2A 6A FF 6A 10 68 9D ) AND  and press enter 
  221.     then you will land at the first match it found
  222.     you 
  223.     (4) should press F2 to get the ASM code of the above string
  224.     (5) then press F3 to edit it 
  225.     (6) You will get a box that will show you a    je   and a address you just need to change the 
  226.     je    to   JNZ then press enter
  227.     (7) now press F9 to update 
  228.     (8) and Press F10 to quit
  229.     now restart Hiew and do each step over again
  230.     The first one is the Save function and if you do it again you will be in the Save As function
  231.     And if you do it a third time you will be in the Save Vectors functioin(not talk about because you 
  232.     must have a scanner to use it) but go ahead and crack it to ..    
  233.     Well that is it after all that you will have a fully working program that will work forever
  234.     Now if you wish to get rid of the DEMO screens that you see when you start the program
  235.     and in the About Box you can continue to Part 3 of the Crack (Must have Borland Resource WorkShop)
  236.     
  237. Part 3 Removing the Demo Screens
  238.  
  239.     Start BRW and locate the Bitmaps that represent the Demo Messages
  240.         239 <--- About Box BitMap
  241.         240 <---- Start up BitMap
  242.     Now lets find the ones for the Full version
  243.         102 <--- Startup BitMap
  244.         159 <--- About Box BitMap
  245.     Now all you have to do is Delete 239 and 240
  246.     then select 102 and then make a Duplicate of it (Right Click of the mouse and you will see Duplicate)
  247.     then do the same for 159 after you have done this it will rename them to something like
  248.     BitMap1  and BitMap 2   well rename the copy of 102 to 240 and the copy of 159 to 239 and that is
  249.     it  you now will see the Full Version srceens when you run your program . Although this is not 
  250.     Needed for the Crack to work this is just another thing you can do to remove the DEMO
  251.     nags But seeing how if you like the Program you are going to Buy it (RIGHT) you reall need not
  252.     do this part ;-)
  253.  
  254. Part 4  Yeah i Know i said 3 parts but read on
  255.     Well if you wish to make a crack that you can distribute to others then you can get
  256.     a program like gpatch or write your onw in your favorite language to do all of the 
  257.     above changes .... Well that is it for this Tutorial
  258.     
  259.     I Hope that you have learned something from this tutorial and i hope i have helped you to
  260.     better understand how this type of protection works. And remember this is a Shareware
  261.     program and if you intend to use it  then Buy It after all they were nice enough to give us
  262.     the demo so we could Crack and Evaluate it so cintribute to them and give them the money
  263.     they ask for   it is only fair........... _CbD_ [ME/C4N'97] 
  264.  
  265.     I want to take a few lines here to say thanks to a few ppl So thanks go to :
  266.     nIabI of [ME/C4N'97] for gpatch and all your help
  267.     Scorpoin of [ME/C4N'97] for the info on Hiew
  268.     mornings on #cracking4Newbies for testing my tuts
  269.     and anyone i forgot :-) Thanks all .............
  270.  
  271.          
  272.         
  273.     
  274.